﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iot.models
{
    class DevciePointInfo
    {
        [Column("id")]
        [Required]
        public string id { get; set; } = string.Empty;

        [Column("device_id")]
        [MaxLength(255)]
        [Required]
        public string deviceId { get; set; } = string.Empty;

        [Column("point_name")]
        [MaxLength(255)]
        [Required]
        public string pointName { get; set; } = string.Empty;

        [Column("point_address")]
        [MaxLength(255)]
        [Required]
        public string pointAddress { get; set; } = string.Empty;

        [Column("ip")]
        [MaxLength(255)]
        public string? ip { get; set; }

        [Column("port")]
        [MaxLength(255)]
        public string? port { get; set; }

        [Column("create_time")]
        public DateTime? createTime { get; set; }

        [Column("update_time")]
        public DateTime? updateTime { get; set; }

        public DevciePointInfo() { }

        public DevciePointInfo(string id, string deviceId, string pointName, string pointAddress, string? ip, string? port, DateTime? createTime, DateTime? updateTime)
        {
            this.id = id;
            this.deviceId = deviceId;
            this.pointName = pointName;
            this.pointAddress = pointAddress;
            this.ip = ip;
            this.port = port;
            this.createTime = createTime;
            this.updateTime = updateTime;
        }
    }
}
